<!--
 * @Author: xuxiuzun 105313046@qq.com
 * @Date: 2022-07-22 09:45:51
 * @LastEditors: xuxiuzun 105313046@qq.com
 * @LastEditTime: 2022-08-19 09:02:15
 * @FilePath: \demo——xin\src\views\modules\basic_settings\operation_log.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->

<!-- 系统设置板块  --  日志管理页面 -->
<template>
	<div>
		<r-search ref="search" :searchData="searchData" :searchForm="searchForm" :searchHandle="searchHandle"
			:inline="true" :searchRules="searchRules" />

		<r-table :isPagination="true" :isHandle="true" :tableData="tableData" :tableCols="tableCols"
			:tablePage="pagination" :loading="tableLoading" :tableHandles="tableHandles" :isSelection="false"
			@refresh="page" />
	</div>
</template>

<script>
export default {
	data() {
		return {
			searchData: {
				// operName:'',
				businessType: '',
				params: ''
			},
			searchForm: [
				// { type: "input",label:'', placeholder: "登录者账号", prop: "operName", width: 200 },
				{
					type: 'select',
					label: '',
					placeholder: '操作类型',
					prop: 'businessType',
					width: 200,
					options: [
						{ value: '0', label: '其它' },
						{ value: '1', label: '新增' },
						{ value: '2', label: '修改' },
						{ value: '3', label: '删除' },
						{ value: '4', label: '授权' },
						{ value: '5', label: '导出' },
						{ value: '6', label: '导入' },
						{ value: '7', label: '强退' },
						{ value: '8', label: '生成代码' },
						{ value: '9', label: '清空数据' }
					]
				}
				// { type: "date",label:'', placeholder: "时间范围", prop: "params", width: 200 },
			],
			searchHandle: [
				{ type: 'primary', label: '搜索', handle: e => this.getData() }
				// {type:'primary',label:'重置', handle: e => this.elFormSubmit(),}
			],
			searchRules: {
				nickName: [{ required: true, message: '请输入管理员名称', trigger: 'blur' }]
			},

			tableLoading: false,
			tableData: [],
			tableCols: [
				{ label: '日志时间', prop: 'operTime' },
				{ label: '操作类型', prop: 'title' },
				{ label: '操作人员', prop: 'operName' },
				{ label: 'IP地址', prop: 'operIp' },
				{ label: '内容', prop: 'remark' }
			],
			tableHandles: [],
			pagination: { limit: 10, offset: 1, total: 1 },
			checkBox: []
		}
	},
	created() { },
	mounted() {
		this.getData()
	},
	methods: {
		async getData() {
			var res = await this.apis.operlog_list({
				pageNum: this.pagination.offset,
				pageSize: this.pagination.limit,
				operName: this.searchData.operName,
				businessType: this.searchData.businessType
				// params:this.searchData.params,
			})
			var list = res.rows || []
			this.tableData = list
			this.pagination.total = res.total
		},
		page() {
			this.getData()
		}
	}
}
</script>

<style scoped>
</style>
